﻿/*文件注释
 * ===============================================================================
 * 说明：
 * 作者：曾永佑
 * 版本：v1.0
 * 创建日期：2013-11-1
 * 完成日期： 
 * 修改纪录：  
 * ===============================================================================
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SRF.Common.Logging.Impl
{
    public class Log4Logger : ILog
    {
        log4net.ILog log;

        public Log4Logger(string name)
        {
            log = log4net.LogManager.GetLogger(name);
        }
        public Log4Logger(Type type)
        {
            log = log4net.LogManager.GetLogger(type);
        }

        public bool IsDebugEnabled
        {
            get
            {
                return log.IsDebugEnabled;
            }
        }
        public bool IsErrorEnabled
        {
            get
            {
                return log.IsErrorEnabled;
            }
        }
        public bool IsFatalEnabled
        {
            get
            {

                return log.IsFatalEnabled;
            }
        }
        public bool IsInfoEnabled
        {
            get
            {

                return log.IsInfoEnabled;
            }
        }
        public bool IsWarnEnabled
        {
            get { return log.IsWarnEnabled; }
        }

        public void Debug(object message)
        {
            log.Debug(message);
        }
        public void Debug(object message, Exception exception)
        {
            log.Debug(message, exception);
        }
        public void DebugFormat(string format, params object[] args)
        {
            log.DebugFormat(format, args);
        }
        public void DebugFormat(IFormatProvider provider, string format, params object[] args)
        {
            log.DebugFormat(provider, format, args);
        }

        public void Error(object message)
        {
            log.Error(message);
        }
        public void Error(object message, Exception exception)
        {
            log.Error(message, exception);
        }
        public void ErrorFormat(string format, params object[] args)
        {
            log.ErrorFormat(format, args);
        }
        public void ErrorFormat(IFormatProvider provider, string format, params object[] args)
        {
            log.ErrorFormat(provider, format, args);
        }

        public void Fatal(object message)
        {
            log.Fatal(message);
        }
        public void Fatal(object message, Exception exception)
        {
            log.Fatal(message, exception);
        }
        public void FatalFormat(string format, params object[] args)
        {
            log.FatalFormat(format, args);
        }
        public void FatalFormat(IFormatProvider provider, string format, params object[] args)
        {
            log.FatalFormat(provider, format, args);
        }

        public void Info(object message)
        {
            log.Info(message);
        }
        public void Info(object message, Exception exception)
        {
            log.Info(message, exception);
        }
        public void InfoFormat(string format, params object[] args)
        {
            log.InfoFormat(format, args);
        }
        public void InfoFormat(IFormatProvider provider, string format, params object[] args)
        {
            log.InfoFormat(provider, format, args);
        }

        public void Warn(object message)
        {
            log.Warn(message);
        }
        public void Warn(object message, Exception exception)
        {
            log.Warn(message, exception);
        }
        public void WarnFormat(string format, params object[] args)
        {
            log.WarnFormat(format, args);
        }
        public void WarnFormat(IFormatProvider provider, string format, params object[] args)
        {
            log.WarnFormat(provider, format, args);
        }
    }
}